
	<script language="javascript" type="text/javascript">
    function CheckCommentLogin(){
      var taget_obj = document.getElementById('_userlogincomments');
      myajax = new DedeAjax(taget_obj,false,false,'','','');
      myajax.SendGet2("{dede:global.cfg_cmspath/}/member/ajax_commentLogin.php");
      DedeXHTTP = null;
    }
	$(document).ready(function(){
	
		if($('#commetcontent').html() == ''){
			$('#commetcontent').html('<p style="padding:10px;">没有评论。</p>');
		}
	});
    </script>

    <div class="comments clearfix">
        <!-- //评论表单 -->
        <div id="_userlogincomments" style="padding-bottom:15px;">
            <h2>您必须登陆后才能留言，<a href="/member/index_do.php?fmdo=user&dopost=regnew">免费注册</a> ┊ <a href="/member/login.php">登录网站</a></h2>
        </div>
		<script language="javascript" type="text/javascript">CheckCommentLogin();</script>
        <div class="commentsform" style=" position:absolute; top:-99999pt;">
            <a name='postform'></a>
            <form action="#" method="post" name="feedback">
                    <input type="hidden" name="dopost" value="send" />
                    <input type="hidden" name="comtype" value="comments">
                    <input type="hidden" name="aid" value="{dede:field name="id"/}" />
                    <input type="hidden" name="fid" id='feedbackfid' value="0" />
                    <p class="n"><label for="msg">内容：</label><textarea cols="60" name="msg" rows="5" class="ipt-txt"></textarea></p>
                    <div class="dcmp-userinfo t" id="_ajax_feedback">
                    {dede:php}
                    if($cfg_mb_open=='Y') {
                    echo '<input style="position:absolute; top:-99999pt;" type="text" name="username" size="16" class="ipt-txt" />';
                    }
                    {/dede:php}
                    {dede:php}
                    if(preg_match("/4/",$safe_gdopen)){
                    echo '<label for="validate">验证码:</label><input type="text" name="validate" size="4" class="ipt-txt" style="text-transform:uppercase;"/><img src= "'.$cfg_cmspath.'/include/vdimgck.php" id="validateimg" style="cursor:pointer" onclick="this.src=this.src+\'?\'" width="60" height="24"  title="点击我更换图片" alt="点击我更换图片" />';
                    }
                    {/dede:php}
                    <input style="position:absolute; top:-99999pt;" type="checkbox" name="notuser" id="dcmp-submit-guest" /><label style="position:absolute; top:-99999pt;" for="dcmp-submit-guest" />匿名? </label>
                    </div>
                    {dede:php}
                    if($cfg_mb_open=='Y') {
                    echo '<script language="javascript" type="text/javascript">CheckLogin();</script>';
                    }
                    {/dede:php}
                     <p class="submit"><strong class="button"><button type="button" onClick='PostComment()'>发表评论</button></strong></p>
            
            
            </form>
        </div>
        <!-- //评论表单区结束 -->
            
            
            
            
        <!-- //评论内容区 -->
        <a name='commettop'></a>
        <h2>最新评论  <!--a href="/youxi/review.asp?ID=23753" title="更多评论"><span>[更多评论]</span></a--></h2>
        <div class="commentlist" id='commetcontentNew'>
        </div>
        <div class="commentlist" id='commetcontent'>
        </div>

        
        
	</div>

	<script language='javascript'>
    function postBadGood(ftype,fid)
    {
        var taget_obj = document.getElementById(ftype+fid);
        var saveid = GetCookie('badgoodid');
        if(saveid != null)
        {
            var saveids = saveid.split(',');
            var hasid = false;
            saveid = '';
            j = 1;
            for(i=saveids.length-1;i>=0;i--)
            {
                if(saveids[i]==fid && hasid) continue;
                else {
                    if(saveids[i]==fid && !hasid) hasid = true;
                    saveid += (saveid=='' ? saveids[i] : ','+saveids[i]);
                    j++;
                    if(j==10 && hasid) break;
                    if(j==9 && !hasid) break;
                }
            }
            if(hasid) { alert('您刚才已表决过了喔！'); return false;}
            else saveid += ','+fid;
            SetCookie('badgoodid',saveid,1);
        }
        else
        {
            SetCookie('badgoodid',fid,1);
        }
        myajax = new DedeAjax(taget_obj,false,false,'','','');
        myajax.SendGet2("{dede:field name='phpurl'/}/feedback.php?aid="+fid+"&action="+ftype+"&fid="+fid);
    }
    function postDigg(ftype,aid)
    {
        var taget_obj = document.getElementById('newdigg');
        var saveid = GetCookie('diggid');
        if(saveid != null)
        {
            var saveids = saveid.split(',');
            var hasid = false;
            saveid = '';
            j = 1;
            for(i=saveids.length-1;i>=0;i--)
            {
                if(saveids[i]==aid && hasid) continue;
                else {
                    if(saveids[i]==aid && !hasid) hasid = true;
                    saveid += (saveid=='' ? saveids[i] : ','+saveids[i]);
                    j++;
                    if(j==20 && hasid) break;
                    if(j==19 && !hasid) break;
                }
            }
            if(hasid) { alert("您已经顶过该帖，请不要重复顶帖 ！"); return; }
            else saveid += ','+aid;
            SetCookie('diggid',saveid,1);
        }
        else
        {
            SetCookie('diggid',aid,1);
        }
        myajax = new DedeAjax(taget_obj,false,false,'','','');
        var url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action="+ftype+"&id="+aid;
        myajax.SendGet2(url);
    }
    function getDigg(aid)
    {
        var taget_obj = document.getElementById('newdigg');
        myajax = new DedeAjax(taget_obj,false,false,'','','');
        myajax.SendGet2("{dede:global.cfg_phpurl/}/digg_ajax.php?id="+aid);
        DedeXHTTP = null;
    }
    function check(){
            if(document.formsearch.searchtype.value=="")
            document.formsearch.action="http://www.google.cn/custom"
            else
            document.formsearch.action="{dede:field name='phpurl'/}/search.php"
        } 
    
    function LoadCommets(page)
    {
            var taget_obj = document.getElementById('commetcontent');
            var waithtml = "<div style='line-height:50px'><img src='{dede:global.cfg_cmsurl/}/images/loadinglit.gif' />评论加载中...</div>";
            var myajax = new DedeAjax(taget_obj, true, true, '', 'x', waithtml);
            myajax.SendGet2("{dede:global.cfg_phpurl /}/feedback_ajax.php?dopost=getlist&aid={dede:field.id/}&page="+page);
            DedeXHTTP = null;
    }
    function PostComment()
    {
            var f = document.feedback;
            //var nface = '6';
            var nfeedbacktype = 'feedback';
            var nvalidate = '';
            var nnotuser = '';
            var nusername = '';
            var npwd = '';
            var taget_obj = $DE('commetcontentNew');
            var waithtml = "<div style='line-height:30px'><img src='{dede:global.cfg_cmsurl/}/images/loadinglit.gif' />正在发送中...</div>";
            if(f.msg.value=='')
            {
                alert("评论内容不能为空！");
                return;
            }
            if(f.validate)
            {
                if(f.validate.value=='') {
                    alert("请填写验证码！");
                    return;
                }
                else {
                    nvalidate = f.validate.value;
                }
            }
            if(f.msg.value.length > 500)
            {
                alert("你的评论是不是太长了？请填写500字以内的评论。");
                return;
            }
			
			
            if(f.feedbacktype) {
                for(var i=0; i < f.feedbacktype.length; i++)
                    if(f.feedbacktype[i].checked) nfeedbacktype = f.feedbacktype[i].value;
            }
            /*if(f.face) {
                for(var j=0; j < f.face.length; j++)
                    if(f.face[j].checked) nface = f.face[j].value;
            }*/
            if(f.notuser.checked) nnotuser = '1';
            if(f.username) nusername = f.username.value;
            if(f.pwd) npwd = f.pwd.value;
            
            var myajax = new DedeAjax(taget_obj, false, true, '', '', waithtml);
            myajax.sendlang = '{dede:global.cfg_soft_lang/}';
            myajax.AddKeyN('dopost', 'send');
            myajax.AddKeyN('aid', '{dede:field.id/}');
            myajax.AddKeyN('fid', f.fid.value);
            //myajax.AddKeyN('face', nface);
            myajax.AddKeyN('feedbacktype', nfeedbacktype);
            myajax.AddKeyN('validate', nvalidate);
            myajax.AddKeyN('notuser', nnotuser);
            myajax.AddKeyN('username', nusername);
            myajax.AddKeyN('pwd', npwd);
            myajax.AddKeyN('msg', f.msg.value);
            myajax.SendPost2('{dede:global.cfg_phpurl/}/feedback_ajax.php');
            f.msg.value = '';
            f.fid.value = 0;
            if(f.validate)
            {
                if($DE('validateimg')) $DE('validateimg').src = "{dede:global.cfg_cmsurl/}/include/vdimgck.php?"+f.validate.value;
                f.validate.value = '';
            }
    }
    function quoteCommet(fid)
    {
        document.feedback.fid.value = fid;
    }
    LoadCommets(1);
    </script><!-- //评论内容区结束 -->
